{% comment %}<!--
Copyright (C) 2009 Attila-Mihaly Balazs

TwitFeeder is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

TwitFeeder is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU Affero General Public License
along with TwitFeeder.  If not, see <http://www.gnu.org/licenses/>
-->{% endcomment %}
{% extends "base.html" %}
{% block content %}
{% if error %}
    <p style="color: red; margin: 5px;">We are terribly sorry, there was an error while
        processing the request. Please make sure that the Twitter user exists
        and try again. The error has been logged and we'll try to fix it as soon
        as possible.</p>
{% endif %}
<p>Following Twitter users via RSS? Get the RSS feed you always wanted:</p>
<ul>
    <li>Contains clickable @links and #hashtags</li>
    <li>Expands short URLs so that you know where you are going to</li>
    <li>Shows the authors avatar for easy distinction</li>
    <li>Get feeds for hashtags! Simply enter a hashtag below.</li>
    <li>Support for alternative sites with Twitter compatible API (laconi.ca, wordpress, etc)</li>
    <li>Support for geo-tagged status updates</li>
</ul>
<p>Just enter the Twitter username below and click "Feed Me!"</p>
<form method="POST" action="/">
<p>
    <label for="username">Twitter user:</label>&nbsp;
    <input id="username" type="text" name="id">&nbsp;
    <button type="submit">Feed Me!</button>
</p>
</form>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function setupUsernameBanner() {
    var txtUsername = $('#username');
    if ('' != txtUsername.val()) return;
    var examples = ['twtfeeder', '@twtfeeder', '#twtfeeder', 'identi.ca/evan'];
    var exampleIndex = 0;

    txtUsername.css('color', '#CCC');

    var intervalId = window.setInterval(function() {
        txtUsername.val(examples[exampleIndex]);
        exampleIndex = (exampleIndex + 1) % examples.length;
    }, 1000);

    var removeAnimation = function () {
        txtUsername.unbind('click', removeAnimation);
        txtUsername.unbind('focus', removeAnimation);
        window.clearInterval(intervalId);
        txtUsername.css('color', '');
        txtUsername.val('');
    };

    txtUsername.click(removeAnimation);
    txtUsername.focus(removeAnimation);
}
setupUsernameBanner();
</script>
{% endblock %}